home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / perl5 / Time::gmtime.z / Time::gmtime
Encoding:
Text File  |  1998-10-30  |  2.8 KB  |  133 lines

  1.  
  2.  
  3.  
  4. TTTTiiiimmmmeeee::::::::ggggmmmmttttiiiimmmmeeee((((3333))))                                                TTTTiiiimmmmeeee::::::::ggggmmmmttttiiiimmmmeeee((((3333))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      Time::gmtime - by-name interface to Perl's built-in _g_m_t_i_m_e() function
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.       use Time::gmtime;
  13.       $gm = gmtime();
  14.       printf "The day in Greenwich is %s\n",
  15.          (qw(Sun Mon Tue Wed Thu Fri Sat Sun))[ gm->wday() ];
  16.  
  17.       use Time::gmtime w(:FIELDS;
  18.       printf "The day in Greenwich is %s\n",
  19.          (qw(Sun Mon Tue Wed Thu Fri Sat Sun))[ gm_wday() ];
  20.  
  21.       $now = gmctime();
  22.  
  23.       use Time::gmtime;
  24.       use File::stat;
  25.       $date_string = gmctime(stat($file)->mtime);
  26.  
  27.  
  28. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  29.      This module's default exports override the core _g_m_t_i_m_e() function,
  30.      replacing it with a version that returns "Time::tm" objects.  This object
  31.      has methods that return the similarly named structure field name from the
  32.      C's tm structure from _t_i_m_e._h; namely sec, min, hour, mday, mon, year,
  33.      wday, yday, and isdst.
  34.  
  35.      You may also import all the structure fields directly into your namespace
  36.      as regular variables using the :FIELDS import tag.  (Note that this still
  37.      overrides your core functions.)  Access these fields as variables named
  38.      with a preceding tm_ in front their method names.  Thus, $tm_obj->_m_d_a_y()
  39.      corresponds to $tm_mday if you import the fields.
  40.  
  41.      The _g_m_c_t_i_m_e() funtion provides a way of getting at the scalar sense of
  42.      the original _C_O_R_E::_g_m_t_i_m_e() function.
  43.  
  44.      To access this functionality without the core overrides, pass the use an
  45.      empty import list, and then access function functions with their full
  46.      qualified names.  On the other hand, the built-ins are still available
  47.      via the CORE:: pseudo-package.
  48.  
  49. NNNNOOOOTTTTEEEE
  50.      While this class is currently implemented using the Class::Struct module
  51.      to build a struct-like class, you shouldn't rely upon this.
  52.  
  53. AAAAUUUUTTTTHHHHOOOORRRR
  54.      Tom Christiansen
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. TTTTiiiimmmmeeee::::::::ggggmmmmttttiiiimmmmeeee((((3333))))                                                TTTTiiiimmmmeeee::::::::ggggmmmmttttiiiimmmmeeee((((3333))))
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.                                                                         PPPPaaaaggggeeee 2222
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.